<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>自定义显示当前的日期</title>
</head>

<body>
<span id="showtime" >
<script>
  var year="";
  mydate=new Date();
  mymonth=mydate.getMonth()+1;
  myday= mydate.getDate();
  myyear= mydate.getFullYear();
  showtime.innerHTML=myyear+"年"+mymonth+"月"+myday+"日  星期"+"日一二三四五六".charAt(new Date().getDay());
</script>
</span>
</body>
</html>
